import axios from '@/libs/api.request'
import {getFullUrl} from '../config'

let getUrl = getFullUrl('user')

//--------------------------------------GET
// 获取所有角色
export const listRole = () => {
  return axios.request({
    url: getUrl('/role'),
    method: 'GET'
  })
}

//--------------------------------------POST
// 添加角色
export const addRole = (role) => {
  return axios.request({
    url: getUrl('/role'),
    method: 'POST',
    data: role
  })
}

//--------------------------------------DELETE
// 添加角色
export const removeRole = (roleId) => {
  return axios.request({
    url: getUrl('/role/' + roleId),
    method: 'DELETE'
  })
}
